-
Notifications
You must be signed in to change notification settings - Fork 12
RFC, WIP: public function to find and return bad channels #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC, WIP: public function to find and return bad channels #214
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
==========================================
+ Coverage 83.43% 84.49% +1.06%
==========================================
Files 26 26
Lines 1696 1716 +20
==========================================
+ Hits 1415 1450 +35
+ Misses 281 266 -15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Please note that it is not Seems reasonable to me. As is often necessary with processing steps using thresholds, we will probably want to implement at some point a function that estimate the optimal threshold based on the properties of the data, rather than using a fixed and arbitrary value. That is more or less what you are saying you are doing with a trial-and-error process for now. |
That would be awesome. OK, I'll clean this up and get the CI's green, and then request a review from you. |
|
Sorry for letting this sit so long. It ended up being more LOC than I anticipated but a lot of that is docstring. Added a test and coverage is slightly increased, if that helps you feel assured that everything I've added here is tested. @christian-oreilly ready for your review! |
christian-oreilly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor (comment/documentation-related) suggestions. One more substantial about avoiding to hardcode the 5e-5 default value at two places.
Co-authored-by: Christian O'Reilly <[email protected]>
|
Thanks @christian-oreilly !!! |
* RFC, WIP: public function to find and return bad channels * TST, DOC: Add test, clean it up * TST: add flag_channels_fixed_threshold step to full pipeline run test * Christian Suggestions (More DRY) [skip actions] [ci skip] Co-authored-by: Christian O'Reilly <[email protected]> * FIX: line length... --------- Co-authored-by: Christian O'Reilly <[email protected]>
* RFC, WIP: public function to find and return bad channels * TST, DOC: Add test, clean it up * TST: add flag_channels_fixed_threshold step to full pipeline run test * Christian Suggestions (More DRY) [skip actions] [ci skip] Co-authored-by: Christian O'Reilly <[email protected]> * FIX: line length... --------- Co-authored-by: Christian O'Reilly <[email protected]>
RFC (Request For comments)
I am opening this as a PR instead of an issue just so that there is a workable example of what I am proposing, to facilitate discussion.
Background
When using the
flag_channels_by_fixed_thresholdmethod in the pipeline class, users are encouraged to specify a threshold that is appropriate for their data. However, finding the right threshold often involves a process of trial and error, and I am increasingly finding this to be tedious with the current API.To streamline this process, I propose adding a standalone function that takes an epochs object and returns a list of "bad" channels based on a given threshold. This would allow users to iterate more quickly in determining an optimal threshold. Then, the method
flag_channels_fixed_thresholdjust wraps this function, so that we aren't duplicating code.Example
I.e. instead of doing this:
You would like to be able to do
If we find this design to be helpful, it could eventually implement it for the other pipeline steps. But for now,
flag_channels_fixed_thresholdisn't even a part of the default pipeline (we only implemented it in order to replicate the MATLAB pipeline for the paper), and so I think that it makes for a good guinea pig for this design (since few if any users probably use it).@christian-oreilly WDYT?